package com.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dao.AnnouncesDao;
import com.model.Announces;

@WebServlet("/UpservletNoFile")
public class UpservletNoFile extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    public UpservletNoFile() {
        super();
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String title=request.getParameter("input-name");
		String body=request.getParameter("textarea-name");
		String file=request.getParameter("file-name");
		
		System.out.println(title+"\t"+body+"\t"+file);
		
		Announces a = new Announces();
		AnnouncesDao ann = new AnnouncesDao();
		a.setAnnouTitle(title);
		a.setAnnouBody(body);
		ann.insert(a);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
